<script language='JavaScript' type='text/javascript'>
function showSecurityTypeSection()
{
    var sectypeidx = document.editrolebasicform.selectsectype.selectedIndex;
    var sectype = document.editrolebasicform.selectsectype.options[sectypeidx].value;
    if(sectype=='ACCESS_SEC')
    {
        hideDiv('datasecuritylist');
        showDiv('accesssecuritylist');
    }
    else if(sectype=='DATA_SEC')
    {
        hideDiv('accesssecuritylist');
        showDiv('datasecuritylist');
    
    }
    else
    {
        hideDiv('accesssecuritylist');
        hideDiv('datasecuritylist');
    
    }
    
    
}
//following thing should come from /themes/.../odotclassic.js file

function showDiv(divId)
{
	if (document.all)
	  document.all[divId].style.display = 'block';
	else if (document.layers)
	  document.layers[divId].display = 'block';
	 else
	 {
	   document.getElementById(divId).style.display='block';
	 }

}

function hideDiv(divId)
{
	if (document.all)
	{
	  document.all[divId].style.display = 'none';
	}
	else if (document.layers)
	{
	  document.layers[divId].display = 'none';
	 }
	 else
	 {
	   document.getElementById(divId).style.display='none';
	 }
}  
</script>

<div id="role_editor" class="object_editor">

<%= error_messages_for 'role' %>
					
											
											<!--[form:role]-->
											

<form name="editrolebasicform" action="/role/edit" method="post" class="appform">

	<div class="req"><b>*</b>Required Information </div>

	<fieldset>
		
		<h3>Edit role definition for '<%= @role.name %>'</h3>
		
		<div id="role_details">

			<label for="role_name"><b><span class="req">*</span>Name</b>
				<input class="f-name" type="text" name="role[name]" value="<%= @role.name %>" size="30" /><br />
			</label>
	
			<label for="role_description"><b>Description</b>
				<textarea class="f-comments" rows="10" cols="25" name="role[description]" ><%= @role.description %></textarea><br />
			</label>

					<!--
  						<p><label for="role_name"><b>Name</b></label>
  						<%= text_field 'role', 'name'  %></p>

  						<p><label for="role_description"><b>Description</b></label>
  						<%= text_area 'role', 'description', {:rows => 10}  %></p>
					-->
					
  						<p><label for="role_description"><b>Select Security Type</b>
    						<select name="selectsectype" onchange="javascript:showSecurityTypeSection();" style="margin-left:10px;">
        					<option value="NONE_SEC" selected>--Select One--</option>
        					<option value="ACCESS_SEC">Access Security</option>
        					<option value="DATA_SEC">Data Security</option>
    					</select></label>
    				
    	</div>
    	
	</fieldset>
	
</form>

												<!--[eoform:role]-->
					
</div>